package com.ypx.imagepicker.helper;

/**
 * @ClassName CustomActionHelper
 * @Description TODO
 * @Author ryan-tang
 * @Date 2022/1/24 16:44
 * @Version 1.0
 */
public class CustomActionHelper {

    private static class SingletonHolder {
        private static CustomActionHelper instance = new CustomActionHelper();
    }

    private CustomActionHelper() {
        System.out.println("Singleton has loaded");
    }

    public static CustomActionHelper getInstance() {
        return SingletonHolder.instance;
    }

    private EditListener mEditListener;
    private RefreshDataEditListener mRefreshEditListener;

    public interface EditListener {
        void onCallBack();
    }

    public interface RefreshDataEditListener {
        void onCallBack();
    }

    public void setEditListener(EditListener mEditListener) {
        this.mEditListener = mEditListener;
    }

    public void setRefreshEditListener(RefreshDataEditListener mRefreshEditListener) {
        this.mRefreshEditListener = mRefreshEditListener;
    }

    public void onEditDataBack() {
        if (mEditListener != null) {
            mEditListener.onCallBack();
        }
    }

    public void onRefreshDataBack() {
        if (mRefreshEditListener != null) {
            mRefreshEditListener.onCallBack();
        }
    }

}
